﻿@{
    Layout = null;
}

@using Git.Framework.DataTypes;
@using Git.Framework.DataTypes.ExtensionMethods;
@{
    Git.Storage.Entity.Biz.SaleOrderEntity Entity = ViewBag.Entity;
}

<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    @Html.Partial("_PageTitle")
</head>
<body class="fixed-top">

    @Html.Partial("_Header")

    <div id="container" class="row-fluid @ViewBag.MenuStatus">
        @Html.Partial("_Sidebar")

        <div id="body">
            <div id="widget-config" class="modal hide">
                <div class="modal-header">
                    <button data-dismiss="modal" class="close" type="button">×</button>
                    <h3>Widget Settings</h3>
                </div>
                <div class="modal-body">
                    <p>Here will be a configuration form</p>
                </div>
            </div>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="span12">
                        @Html.Raw(ViewBag.NavMenu)
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span12">
                        <div class="widget box light-grey">
                            <div class="widget-title">
                                <h4><i class="icon-globe"></i>新增销售订单</h4>
                            </div>
                            <div class="widget-body">
                                <div class="horizontal-form">
                                    <div class="row-fluid">
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="OrderNum">销售单号</label>
                                                <div class="controls">
                                                    <input type="text" name="OrderNum" class="span12" placeholder="可不填,自动生成" disabled="disabled" value="@Entity.OrderNum">
                                                    <input type="hidden" name="SnNum" value="@Entity.SnNum"/>
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="OrderType">单据类型</label>
                                                <div class="controls">
                                                    <select name="OrderType" class="span12">
                                                        @Html.Raw(ViewBag.OrderType)
                                                    </select>
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="ContractOrder">关联订单号</label>
                                                <div class="controls">
                                                    <input type="text" name="ContractOrder" class="span12" placeholder="" value="@Entity.ContractOrder">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="CreateUserName">制单人</label>
                                                <div class="controls">
                                                    <input type="text" name="CreateUserName" class="span12" placeholder="" value="@Entity.CreateUserName">
                                                    <input type="hidden" name="CreateUser" value="@Entity.CreateUser"/>
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row-fluid">
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="CusNum">客户编号</label>
                                                <div class="controls">
                                                    <input type="text" name="CusNum" class="span12" placeholder="输入关键字搜索或者双击选择" value="@Entity.CusNum">
                                                    <input type="hidden" name="CusSnNum" value="@Entity.CusSnNum"/>
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="CusName">客户名称</label>
                                                <div class="controls">
                                                    <input type="text" name="CusName" class="span12" placeholder="" value="@Entity.CusName">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="Contact">联系人</label>
                                                <div class="controls">
                                                    <input type="text" name="Contact" class="span12" placeholder="" value="@Entity.Contact">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="Phone">电话</label>
                                                <div class="controls">
                                                    <input type="text" name="Phone" class="span12" placeholder="" value="@Entity.Phone">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row-fluid">
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="OrderTime">制单日期</label>
                                                <div class="controls">
                                                    <input type="text" name="OrderTime" class="span12" placeholder="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="@Entity.OrderTime.To("yyyy-MM-dd")">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span3">
                                            <div class="control-group">
                                                <label class="control-label" for="SendDate">发货日期</label>
                                                <div class="controls">
                                                    <input type="text" name="SendDate" class="span12" placeholder="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" value="@Entity.SendDate.To("yyyy-MM-dd")">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span6">
                                            <div class="control-group">
                                                <label class="control-label" for="Remark">备注</label>
                                                <div class="controls">
                                                    <input type="text" name="Remark" class="span12" placeholder="" value="@Entity.Remark">
                                                    <span class="help-block"></span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                

                                <table class="table table-striped table-bordered table-hover" id="tabList">
                                    <thead>
                                        <tr>
                                            <th></th>
                                            <th>产品名称</th>
                                            <th>产品编码</th>
                                            <th>规格</th>
                                            <th>单价</th>
                                            <th>单位</th>
                                            <th>数量</th>
                                            <th>总价</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                </table>

                                <div id="mypager" class="row-fluid" style="vertical-align:top;">

                                </div>


                                <div class="form-actions formbtn">
                                    <button type="submit" class="btn btn-danger" data-command="Add"><i class="icon-plus"></i>新增产品</button>
                                    <button type="submit" class="btn btn-primary" data-command="Save"><i class="icon-ok"></i>保存</button>
                                    <button type="button" class="btn" data-command="Cancel">取消</button>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    @Html.Partial("_Foot")
    
    <script src="/Theme/customer/Biz/Git.Framework.SaleOrder.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            App.init();
            SaleOrder.Init();
        });
    </script>
</body>
</html>